package com.atguigu.userprofile.common.dao

import com.atguigu.userprofile.common.bean.{TagInfo, TaskInfo}
import com.atguigu.userprofile.common.util.MySqlUtil

object TaskInfoDAO {


  def  getTaskInfo(taskId:String): TaskInfo ={

    var taskInfo:TaskInfo=null
    val maybeTaskInfo: Option[TaskInfo] = MySqlUtil.queryOne(s"select * from task_info where id=$taskId" ,classOf[TaskInfo],true)
    if(maybeTaskInfo==None){
      throw  new RuntimeException(s" no task for taskId :$taskId")
    }else{
      taskInfo=maybeTaskInfo.get
    }
    taskInfo
  }
}
